#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
using namespace std;
//测试 int tos tring
string i2s(int a){
    string b;
    // floor 向下取整 ceil 向上取整
    while(a > 0 && floor(a/10) >= 0){
        if(floor(a/10) == 0){
            b += a + '0';
            break;
        }else{
          b += a % 10  + '0';
          a = floor(a/10);
        }
    }
    reverse(b.begin(), b.end());
    return b;
} 

int s2i(string b){
    // reverse(b.begin(), b.end());
    int flag = 1;
    int a = 0;
    for(int i = b.length() - 1; i >= 0; i--){
        a += (b[i] - '0') * flag;
        flag *= 10;
    }
    return a;
}


int main(int argc, char const *argv[])
{
    /* code */
    long long a;
    string b;
    cin >> a;
    cout << i2s(a) << endl;
    b = i2s(a);
    cout << s2i(b) << endl;
    return 0;
}
